<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  // console.log( localStorage );

  // console.log( localStorage.length );

  // localStorage.top = "666";
  
  // console.log( localStorage.top );
  
  // localStorage.hello = "hahaahaha"
  
  // console.log( localStorage.hello );

  // delete localStorage.left;

  // ======

  // 查
  // console.log(localStorage.getItem("top"));
  // console.log(localStorage.getItem("userData"));

  // 增或改
  // localStorage.setItem( "name", "admin" )
  // localStorage.setItem( "pw", "123456" )

  // console.log( localStorage.getItem("name") )
  // console.log( localStorage.getItem("pw") )

  // 删除单条
  // localStorage.removeItem( "name" )
  // localStorage.removeItem( "pw" )

  // 清空所有
  // localStorage.clear();

  console.log(localStorage);



  // ==========


  // sessionStorage.setItem( "name", "admin" )
  // sessionStorage.setItem( "pw", "123456" )


  console.log(sessionStorage);


</script>
</html>